Add a shortname test.
authorrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Fri, 29 Aug 2003 21:59:34 +0000 (21:59 +0000)
committerrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Fri, 29 Aug 2003 21:59:34 +0000 (21:59 +0000)
gpsbabel/testo

index 9a8291cbade0f4766af394736ffa454a62aa5ba5..3bef60b53f9654b079b37104c1670d646bf6c58e 100755 (executable)
@@ -346,3 +346,22 @@ ${PNAME} -i xmap -f reference/arcdist_input.txt \
          -o xmap -F ${TMPDIR}/polygon.txt
 compare ${TMPDIR}/polygon.txt reference/polygon_output.txt
 
+
+
+
+#
+# This is  nasty.   If we have a dictionary handy, treat it as a list of
+# waypoints and reduce all the names to eight characters.   Fewer chars
+# results in lost waypoints currently and that's a defect.
+#
+DICT=/usr/share/dict/words
+if [ -f $DICT ]; 
+then
+       WORDS=`cat $DICT | wc -l`
+       SWORDS=`${PNAME} -i gpsdrive -f $DICT -o gpsdrive,snlen=8 -F /dev/fd/1 | wc -l`
+       if [ $WORDS -ne $SWORDS ];
+       then
+               echo "Shortname reduction failed."
+               exit 1  
+       fi
+fi